<?php die;?><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><!--{$title}--></title>
<style type="text/css">
<!--
html {overflow-x:auto; overflow-y:hidden;}
-->
</style>
<link href="css/default.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.STYLE1 {
	font-size: 16px;
	font-weight: bold;
	color: #0000CC;
}
.STYLE6 {font-size: 14}
.STYLE7 {
	font-size: 14px;
	font-weight: bold;
}
.STYLE8 {color: #0000CC}
td.bottomline {
	border-bottom: 1px solid #e9e9e9;
}
.db_avail0 {
	color: red;
	font-weight: normal;
}
.db_avail1 {
	color: red;
	font-weight: normal;
}
.db_avail2 {
	color: gray;
	font-weight:bold;
}
.db_avail3 {
	color: green;
	font-weight:bold;
}
-->
</style>
<script language="JavaScript">
function CheckForm()
{
 if (document.form1.MICE_URL.value.length == 0)
 {
  alert("网址不能为空！");
  document.form1.MICE_URL.focus();
  return false;
 } 
 if (document.form1.MICE_EXT.value.length == 0)
 {
  alert("模板后缀不能为空！");
  document.form1.MICE_EXT.focus();
  return false;
 } 
 if (document.form1.MICE_DBNAME.value.length == 0)
 {
  alert("数据库名不能为空！");
  document.form1.MICE_DBNAME.focus();
  return false;
 } 
  return true;
}
</script>
</head>

<body>
<table width="100%" height="45" border="0" align="center" cellpadding="0" cellspacing="0" background="imgs/top-banner.gif">
  <tr>
	<td width="280" rowspan="2"><img src="imgs/logo.gif" width="212" height="45" border="0" alt="logo"/></td>
	<td width="630" height="23">&nbsp;</td>
	<td width="110" rowspan="2">&nbsp;</td>
  </tr>
  <tr>
	<td width="280">&nbsp;</td>
	<td width="630" height="22"><table width="500" height="22" border="0" cellpadding="0" cellspacing="0">
	  <tr>
		<td><div id="history"></div></td>
	  </tr>
	</table></td>
  </tr>
</table>
<br>
<table width="980" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="120" align="center" valign="top"><table width="120" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#D5D5D5">
      <tr>
        <td height="28" bgcolor="#F9F9F9"><span class="STYLE1">&nbsp;安装步骤</span></td>
      </tr>
      <tr>
        <td height="28" bgcolor="#FFFFFF"><span class="STYLE6">&nbsp;&nbsp;1、许可协议</span></td>
      </tr>
      <tr>
        <td height="28" bgcolor="#FFFFFF"><span class="STYLE6">&nbsp;&nbsp;2、环境检测</span></td>
      </tr>
      <tr>
        <td height="28" bgcolor="#FFFFFF"><span class="STYLE6">&nbsp;&nbsp;<span class="STYLE8">3、参数配置</span></span></td>
      </tr>
      <tr>
        <td height="28" bgcolor="#FFFFFF"><span class="STYLE6">&nbsp;&nbsp;4、正在安装</span></td>
      </tr>
      <tr>
        <td height="28" bgcolor="#FFFFFF"><span class="STYLE6">&nbsp;&nbsp;5、安装完成</span></td>
      </tr>
    </table></td>
    <td width="860" align="center" valign="top"><table width="850" border="0" cellpadding="0" cellspacing="1" bgcolor="#D5D5D5">
	<form name="form1" id="form1" method="POST" action="<!--{$smarty.const.MICE_URL}-->install.php/install" onsubmit="return CheckForm()">
      <tr>
        <td height="28" bgcolor="#F9F9F9">&nbsp;<span class="STYLE7">主选项</span></td>
      </tr>
      <tr>
        <td height="28" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="28" class="bottomline" width="300">&nbsp;网站地址(包括根路径)</td>
    <td height="28" class="bottomline"><input type="text" size="35" name="MICE_URL" value="<!--{php}-->echo "http://" . $_SERVER['SERVER_NAME'].substr($_SERVER['SCRIPT_NAME'],0,strlen($_SERVER['SCRIPT_NAME'])-11);<!--{/php}-->">&nbsp;网址最后必须加&nbsp;/</td>
  </tr>
  <tr>
    <td height="28" class="bottomline" width="300">&nbsp;网站标题(你的网站的标题)</td>
    <td height="28" class="bottomline"><input type="text" size="35" name="MICE_TITLE" value="miceCMS 示范网站"></td>
  </tr>
  <tr>
    <td height="28" class="bottomline" width="300">&nbsp;服务器时间和您当前的时间相差</td>
    <td height="28" class="bottomline"><select name="MICE_GMT"><option value="Etc/GMT+12">-12</option><option value="Etc/GMT+11">-11</option><option value="Etc/GMT+10">-10</option><option value="Etc/GMT+9">-9</option><option value="Etc/GMT+8">-8</option><option value="Etc/GMT+7">-7</option><option value="Etc/GMT+6">-6</option><option value="Etc/GMT+5">-5</option><option value="Etc/GMT+4">-4</option><option value="Etc/GMT+3">-3</option><option value="Etc/GMT+2">-2</option><option value="Etc/GMT+1">-1</option><option value="Etc/GMT+0" selected>0</option><option value="Etc/GMT-1">+1</option><option value="Etc/GMT-2">+2</option><option value="Etc/GMT-3">+3</option><option value="Etc/GMT-4">+4</option><option value="Etc/GMT-5">+5</option><option value="Etc/GMT-6">+6</option><option value="Etc/GMT-7">+7</option><option value="Etc/GMT-8">+8</option><option value="Etc/GMT-9">+9</option><option value="Etc/GMT-10">+10</option><option value="Etc/GMT-11">+11</option><option value="Etc/GMT-12">+12</option></select>&nbsp;&nbsp;小时(服务器时间：<!--{php}-->echo date("Y-m-d H:i:s");<!--{/php}-->,如果和您当前的时间相同,请勿修改)</td>
  </tr>
  <tr>
    <td height="28" class="bottomline" width="300">&nbsp;是否启用是否启用Apache的ReWrite功能</td>
    <td height="28" class="bottomline"><select name="MICE_REWRITE"><option value="">启用</option><option value="index.php/" selected>不启用</option></select></td>
  </tr>
  <tr>
    <td height="28" class="bottomline" width="300">&nbsp;HTML静态页面的生成方式</td>
    <td height="28" class="bottomline"><select name="MICE_HTML"><option value="0" <!--{if $smarty.const.MICE_HTML=="0"}-->selected<!--{/if}-->>不生成</option><option value="1" <!--{if $smarty.const.MICE_HTML=="1"}-->selected<!--{/if}-->>纯静态(手动生成)</option><option value="2" <!--{if $smarty.const.MICE_HTML=="2"}-->selected<!--{/if}-->>伪静态(触发式生成)</option></select></td>
  </tr>
  <tr>
    <td height="28" class="bottomline" width="300">&nbsp;是否启用miceCMS自带的php配置文件php.ini</td>
    <td height="28" class="bottomline"><select name="MICE_INISET"><option value="1">启用(推荐)</option><option value="0">不启用</option></select></td>
  </tr>
  <tr>
    <td height="28" class="bottomline" width="300">&nbsp;是否启用图片验证码</td>
    <td height="28" class="bottomline"><select name="MICE_CCIMG"><option value="1">启用(推荐)</option><option value="0">不启用</option></select></td>
  </tr>
  <tr>
    <td height="28" class="bottomline" width="300">&nbsp;可上传的文件类型(用逗号[,]分割)</td>
    <td height="28" class="bottomline"><input type="text" size="35" name="MICE_UPLOAD_FILE_NAME" value="swf,jpg,gif,png,wav,mp3,rar,zip,7z,iso,doc,ppt,xls,pdf,txt"></td>
  </tr>
  <tr>
    <td height="28" class="bottomline" width="300">&nbsp;单个文件上传最大容量(单位KB)</td>
    <td height="28" class="bottomline"><input type="text" size="35" name="MICE_UPLOAD_FILE_SIZE" value="2048">&nbsp;当前服务器允许上传的文件最大为<!--{php}-->echo ini_get("upload_max_filesize");<!--{/php}-->(1MB=1024KB)</td>
  </tr>
  <tr>
    <td height="28" class="bottomline" width="300">&nbsp;网站模板</td>
    <td height="28" class="bottomline"><select name="MICE_TPL"><!--{php}-->
	include_once MICE_DIR.'/includes/filelist.php';
	$table_data=read_dir(MICE_DIR.'templates/',"dir",true);
	foreach ($table_data as $key => $row)
	{
		echo '<option value="templates/'.$row['id'].'">'.$row['id'].'</option>';
	}
	<!--{/php}-->
	</select>
	</td>
  </tr>
  <tr>
    <td height="28" class="bottomline" width="300">&nbsp;模板后缀</td>
    <td height="28" class="bottomline"><input type="text" size="35" name="MICE_EXT" value=".php"></td>
  </tr>
</table>
</td>
      </tr>
    </table>
      <table width="100%" height="5" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td></td>
        </tr>
      </table>
	  <table width="850" border="0" cellpadding="0" cellspacing="1" bgcolor="#D5D5D5">  
  <tr>
    <td height="28" bgcolor="#F9F9F9">&nbsp;<span class="STYLE7">数据库设置</span></td>
  </tr>
  <tr>
    <td height="28" bgcolor="#FFFFFF">&nbsp;数据库类型选择框说明：<br><span style="color:green; font-weight:bold">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;绿色选项</span> 的数据库系统目前可用<br><span style="color:gray; font-weight:bold">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;灰色选项</span> 表示当前服务器上的PHP已经支持此数据库,但需要到下载安装相应的<a href="http://www.micecms.com/cms/index.php/list/131/1" target="_blank">驱动程序</a><br><span style="color:red; font-weight:bold">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;红色选项</span> 表示当前服务器上的PHP不支持此数据库(您需要 修改PHP设置)<br><br></td>
  </tr>
  <tr>
    <td height="28" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="28" class="bottomline" width="300">&nbsp;数据库类型</td>
        <td height="28" class="bottomline"><select name="MICE_DB"><!--{php}-->
		function txt_connect() { }
		$databases = array(
				array('txt' , '文本文件(Flat File)', 'txt_connect'),
				array('mysql' , 'MySQL', 'mysql_connect'),
				array('mysqli' , 'MySQLi', 'mysqli_connect'),
				array('sqlite' , 'SQLite2', 'sqlite_open'),
				array('mssql' , 'Microsoft SQL Server', 'mssql_pconnect'),
				array('postgres' , 'PostgresSQL', 'pg_connect'),
				array('postgres64' , 'PostgresSQL 6.4', 'pg_connect'),
				array('postgres7' , 'PostgresSQL 7', 'pg_connect'),
				array('postgres8' , 'PostgresSQL 8', 'pg_connect'),
				);
			
		for($i=0;$i<count($databases);$i++) {
			$db =& $databases[$i];
			if($db[0]=='txt'){
				$db0='gladius';
			}else{
				$db0=$db[0];
			}
			$db[3] = (int)is_dir(MICE_DIR.'classes/adodb_lite/drivers/'.$db0);
			$db[3] |= (((int)function_exists($db[2])) << 1);
		}

		for($i=0;$i<count($databases);$i++) {
			$db =& $databases[$i];
		}


		for($i=0;$i<count($databases);$i++) {
			$db =& $databases[$i];
			$class = ' class="db_avail'.$db[3].'"';
			echo '<option value="'.$db[0].'"';
			echo $class;
			if($i==1)	echo 'selected';
			echo '>'.$db[1].'</option>'."\r\n";
		}
		<!--{/php}-->
		</select></td>
      </tr>
	  <tr>
		<td height="28" class="bottomline" width="300">&nbsp;</td>
		<td height="28" class="bottomline"><span style="color:red; font-weight:bold">注意：</span><br>如果您没有一个专业的数据库系统, 如 MySQL 或 SQL Server, 您可以选择<b>文本文件(Falt File)</b>数据库,它采用PHP+TXT的方式存储数据库,无需您做任何操作。<a href="http://www.micecms.com/cms/index.php/article/125/67" target="_blank">详细了解</a><br><br></td>
	  </tr>
	  <tr>
		<td height="28" class="bottomline" width="300">&nbsp;数据库名称</td>
		<td height="28" class="bottomline"><input type="text" size="35" name="MICE_DBNAME" value="micecms"></td>
	  </tr>
	  <tr>
		<td height="28" class="bottomline" width="300">&nbsp;数据库表前缀</td>
		<td height="28" class="bottomline"><input type="text" size="35" name="MICE_PREFIX" value="mice_">&nbsp;实际表名=前缀+系统定义表名</td>
	  </tr>
	  <tr>
		<td height="28" class="bottomline" width="300">&nbsp;</td>
		<td height="28" class="bottomline">&nbsp;</td>
	  </tr>
	  <tr>
		<td height="28" class="bottomline" width="300">&nbsp;</td>
		<td height="28" class="bottomline">如果你选择了文本文件(Flat File)或者Sqlite数据库,以下选项不用填写</td>
	  </tr>
	  <tr>
		<td height="28" class="bottomline" width="300">&nbsp;数据库主机地址</td>
		<td height="28" class="bottomline"><input type="text" size="35" name="MICE_DBHOST" value="localhost">&nbsp;一般都是:localhost 或 127.0.0.1</td>
	  </tr>
	  <tr>
		<td height="28" class="bottomline" width="300">&nbsp;数据库用户名</td>
		<td height="28" class="bottomline"><input type="text" size="35" name="MICE_DBUSERNAME" value="root"></td>
	  </tr>
	  <tr>
		<td height="28" class="bottomline" width="300">&nbsp;数据库密码</td>
		<td height="28" class="bottomline"><input type="password" size="35" name="MICE_DBPASSWORD" value=""></td>
	  </tr>
    </table></td>
  </tr>
      </table>
	  <table width="100%" height="5" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td></td>
        </tr>
      </table>
	  <table width="850" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#D5D5D5">
      <tr >
        <td bgcolor="#F9F9F9" height="30" valign='middle'>&nbsp;&nbsp;<input name="button" type="button" accesskey="p" onClick="javascript:history.back(-1)" value="上一步[P]"/>
          &nbsp;&nbsp;
          <input name="submit" type="submit" accesskey="N" value="下一步[N]"/>
        </td>
      </tr></form>
    </table></td>
  </tr>
</table>
</body>
</html>
